/**
 * @param {number[]} numbers
 * @return {number}
 */
var minArray = function (numbers) {
  let n = numbers.length
  if (n > 0) {
    if (numbers[n - 1] <= numbers[0]) {
      while (numbers[n - 2] <= numbers[n - 1]) {
        n--
      }
      return numbers[n - 1]
    }
    return numbers[0]
  }
};